{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-06-23T13:09:31.434657Z",
     "start_time": "2025-06-23T13:09:31.091841Z"
    }
   },
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ],
   "outputs": [],
   "execution_count": 1
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-23T13:09:31.964312Z",
     "start_time": "2025-06-23T13:09:31.958075Z"
    }
   },
   "cell_type": "code",
   "source": [
    "df = pd.DataFrame(\n",
    "    {\n",
    "        \"X\": [f\"Sample{i}\" for i in range(1,21)],\n",
    "        \"Y\": np.random.uniform(10, 100, 20)\n",
    "    }\n",
    ")"
   ],
   "id": "6489b16a04d0d7e9",
   "outputs": [],
   "execution_count": 2
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-23T13:09:32.497941Z",
     "start_time": "2025-06-23T13:09:32.491416Z"
    }
   },
   "cell_type": "code",
   "source": "df",
   "id": "f3076d292bdda90f",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "           X          Y\n",
       "0    Sample1  54.019932\n",
       "1    Sample2  57.289450\n",
       "2    Sample3  84.270235\n",
       "3    Sample4  62.162735\n",
       "4    Sample5  99.068340\n",
       "5    Sample6  84.044901\n",
       "6    Sample7  53.230614\n",
       "7    Sample8  33.507592\n",
       "8    Sample9  72.393536\n",
       "9   Sample10  46.862898\n",
       "10  Sample11  10.059865\n",
       "11  Sample12  62.006037\n",
       "12  Sample13  61.576312\n",
       "13  Sample14  46.159614\n",
       "14  Sample15  56.969928\n",
       "15  Sample16  60.655552\n",
       "16  Sample17  76.360609\n",
       "17  Sample18  37.024261\n",
       "18  Sample19  28.616184\n",
       "19  Sample20  66.789520"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>X</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Sample1</td>\n",
       "      <td>54.019932</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Sample2</td>\n",
       "      <td>57.289450</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Sample3</td>\n",
       "      <td>84.270235</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Sample4</td>\n",
       "      <td>62.162735</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Sample5</td>\n",
       "      <td>99.068340</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Sample6</td>\n",
       "      <td>84.044901</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Sample7</td>\n",
       "      <td>53.230614</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Sample8</td>\n",
       "      <td>33.507592</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Sample9</td>\n",
       "      <td>72.393536</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Sample10</td>\n",
       "      <td>46.862898</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Sample11</td>\n",
       "      <td>10.059865</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Sample12</td>\n",
       "      <td>62.006037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Sample13</td>\n",
       "      <td>61.576312</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Sample14</td>\n",
       "      <td>46.159614</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Sample15</td>\n",
       "      <td>56.969928</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Sample16</td>\n",
       "      <td>60.655552</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>Sample17</td>\n",
       "      <td>76.360609</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>Sample18</td>\n",
       "      <td>37.024261</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Sample19</td>\n",
       "      <td>28.616184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>Sample20</td>\n",
       "      <td>66.789520</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 3
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-23T13:09:32.980491Z",
     "start_time": "2025-06-23T13:09:32.898146Z"
    }
   },
   "cell_type": "code",
   "source": "df.to_excel(\"example.xlsx\", header=True, index=False, engine=\"openpyxl\")",
   "id": "6e247370a1881daf",
   "outputs": [],
   "execution_count": 4
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-06-23T13:09:33.303539Z",
     "start_time": "2025-06-23T13:09:33.299120Z"
    }
   },
   "cell_type": "code",
   "source": "df.to_csv(\"example.csv\", header=True, index=False, encoding=\"utf-8\")",
   "id": "87c45ba0101ae9d7",
   "outputs": [],
   "execution_count": 5
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "75ba58fb428cf4be"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
